<!DOCTYPE html>
<html>

	<body>
		<a href="http://127.0.0.1/test/type.html">test</a>
		<script>
			var EventUtil = {
				addHandler : function(element, type, handler) {
					if (element.addEventListener) {
						element.addEventListener(type, handler, false);
					} else if (element.attachEvent) {
						element.attachEvent("on" + type, handler);
					} else {
						element["on" + type] = handler;
					}
				}
			};
			(function() {
				var showCount = 0;
				EventUtil.addHandler(window, "load", function() {
					alert("Load");
				});
				EventUtil.addHandler(window, "pageshow", function(event) {
					showCount++;
					alert("Show has been fired " + showCount + " times.");
				});
				EventUtil.addHandler(window, "pagehide", function(event) {
					alert("Hiding");
				});
			})();

		</script>
	</body>
</html>
